package cn.eshore.bnet.bpm.service;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.def.Node;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.graph.exe.Token;

public class ExceptionHandleAction implements ActionHandler {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    static Log LOG = LogFactory.getLog(ExceptionHandleAction.class);

    @Override
    public void execute(ExecutionContext executionContext) throws Exception {
        LOG.info(" enter ExceptionHandleAction ");
        final Throwable exception = executionContext.getException();
        Token token = executionContext.getToken();
        // LOG.info(" token.suspend()" + token.getId());
        Node node = executionContext.getContextInstance().getProcessInstance()
                .getProcessDefinition().getNode("查勘(CODE:order00001)");
        token.setNode(node);
        LOG.info("NODE NAME :" + token.getNode().getName());
    }
}
